/**
 * 
 */
package com.thor.palmmall.rest.chart.converter;

import org.springframework.core.convert.converter.Converter;

import com.thor.palmmall.rest.chart.APassengersReport;
import com.thor.palmmall.spi.chart.SPassengersReport;

/**
 * @author NuoSa
 *
 * @since 1.0
 */
public class APassengersReportConverter implements Converter<SPassengersReport, APassengersReport> {

  public static APassengersReportConverter getInstance() {
    if (instance == null)
      instance = new APassengersReportConverter();
    return instance;
  }

  private static APassengersReportConverter instance;

  private APassengersReportConverter() {
  }

  @Override
  public APassengersReport convert(SPassengersReport source) {
    if (source == null) {
      return null;
    }
    APassengersReport target = new APassengersReport();
    target.setEntrance(source.getEntrance());
    target.setInVolume(source.getInVolume());
    target.setInVolumeRate(source.getInVolumeRate());
    target.setOutVolume(source.getOutVolume());
    return target;
  }

}
